package com.tughluq.erp

import android.os.Bundle
import android.view.View
import android.os.Build

import io.flutter.app.FlutterActivity
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity(): FlutterActivity() {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    GeneratedPluginRegistrant.registerWith(this)

//    hideBottomUIMenu()
  }

  /**
   * 隐藏虚拟按键，并且全屏
   */
  protected fun hideBottomUIMenu() {
    //隐藏虚拟按键，并且全屏
    if (Build.VERSION.SDK_INT > 11 && Build.VERSION.SDK_INT < 19) { // lower api
      val v = this.getWindow().getDecorView()
      v.setSystemUiVisibility(View.GONE)
    } else if (Build.VERSION.SDK_INT >= 19) {
      //for new api versions.
      val decorView = getWindow().getDecorView()
      val uiOptions = (View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
              or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY or View.SYSTEM_UI_FLAG_FULLSCREEN)
//              or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)
      decorView.setSystemUiVisibility(uiOptions)
    }
  }
}
